package com.zygh.policeasset.service;

import com.zygh.policeasset.mapper.PurchaseQrCodeInfoMapper;
import com.zygh.policeasset.mapper.QrCodeInfoMapper;
import com.zygh.policeasset.pojo.BingDistribution;
import com.zygh.policeasset.pojo.SelectDistribution;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
/* loaded from: police-asset-2.0-0.0.1-SNAPSHOT.jar:BOOT-INF/classes/com/zygh/policeasset/service/QrCodeInfoService.class */
public class QrCodeInfoService {
    @Autowired
    PurchaseQrCodeInfoMapper purchaseQrCodeInfoMapper;

    @Autowired
    com.zygh.policeasset.mapper.QrCodeInfoMapper qrCodeInfoMapper;

    public Integer delete(String ids) {
        Integer count = null;
        for (String id : ids.split(",")) {
            count = this.purchaseQrCodeInfoMapper.deleteById(Integer.valueOf(Integer.parseInt(id)));
        }
        return count;
    }

    public Integer remainCount() {
        return this.purchaseQrCodeInfoMapper.remainCount();
    }

    public List<SelectDistribution> selectDistribution(String userName) {
        return this.qrCodeInfoMapper.selectDistribution(userName);
    }

    public List<String> selectDistributionByUserId(Integer userId) {
        return this.qrCodeInfoMapper.selectDistributionByUserId(userId);
    }

    public Integer distribution(BingDistribution bingDistribution) {
        return this.qrCodeInfoMapper.bingDistribution(bingDistribution.getQrCodes().split(","),bingDistribution.getUserId());
    }
}